<?php

namespace App\Models;

use Eloquent as Model;
use Illuminate\Database\Eloquent\SoftDeletes;

/**
 * Class Qrcode
 * @package App\Models
 * @version April 23, 2018, 7:21 am UTC
 *
 * @property integer shop_id
 * @property integer type
 * @property string url
 */
class Qrcode extends Model
{
    use SoftDeletes;

    public $table = 'qrcodes';
    

    protected $dates = ['deleted_at'];


    public $fillable = [
        'shop_id',
        'type',
        'title',
        'url',
        'pic_url',
        'scan_number',
    ];

    /**
     * The attributes that should be casted to native types.
     *
     * @var array
     */
    protected $casts = [
        'shop_id' => 'integer',
        'type' => 'integer',
        'url' => 'string'
    ];

    /**
     * Validation rules
     *
     * @var array
     */
    public static $rules = [
        
    ];

    public function shop()
    {
        return $this->belongsTo('App\Models\Shop');
    }

    public function scanLogs()
    {
        return $this->hasMany('App\Models\ScanLog');
    }
}
